<!-- 单规则 -->
<template>
  <div class="SingleRule">
    <!-- 表格 -->
    <el-table :data="tableData" border style="width: 100%">
      <el-table-column prop="img" label="照片" width="">图片 </el-table-column>
      <!-- 售价 -->
      <el-table-column prop="prices" label="售价" width="">
        <template slot-scope="scope">
          <el-input v-model="scope.row.prices"></el-input>
        </template>
      </el-table-column>
      <!--成本价  -->
      <el-table-column prop="Costprice" label="成本价">
        <template slot-scope="scope">
          <el-input v-model="scope.row.Costprice"></el-input>
        </template>
      </el-table-column>
      <!-- 原价 -->
      <el-table-column prop="originalprice" label="原价">
        <template slot-scope="scope">
          <el-input v-model="scope.row.originalprice"></el-input>
        </template>
      </el-table-column>
      <!-- 库存 -->
      <el-table-column prop="stock" label="库存">
        <template slot-scope="scope">
          <el-input v-model="scope.row.stock"></el-input>
        </template>
      </el-table-column>
      <!-- 商品编号 -->
      <el-table-column prop="Commoditycode" label="商品编号">
        <template slot-scope="scope">
          <el-input v-model="scope.row.Commoditycode"></el-input>
        </template>
      </el-table-column>
      <!-- 重量（KG） -->
      <el-table-column prop="weight" label="重量（KG）">
        <template slot-scope="scope">
          <el-input v-model="scope.row.weight"></el-input>
        </template>
      </el-table-column>
      <!-- 体积（m） -->
      <el-table-column prop="volume" label="体积（m）">
        <template slot-scope="scope">
          <el-input v-model="scope.row.volume"></el-input>
        </template>
      </el-table-column>
    </el-table>
    <!-- <button @click="tableDatas">asxaq</button> -->
  </div>
</template>

<script>
export default {
  name: "SingleRule",
  //import引入的组件需要注入到对象中才能使用
  components: {},
  data() {
    //这里存放数据
    return {
      tableData: [
        {
          img: "0",
          prices: "0",
          Costprice: "0",
          originalprice: "0",
          stock: "0",
          Commoditycode: "0",
          weight: "0",
          volume: "0",
        },
      ],
    };
  },

  //监听属性 类似于data概念
  computed: {},
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {
    tableDatas() {
      let isNull = false;
      this.tableData.map((item) => {
        let keys = Object.keys(item);
        keys.map((k) => {
          if (item[k]) {
            isNull = true;
          } else {
          }
        });
      });
    },
  },
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {},
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {},
};
</script>
<style lang="scss" scoped>
.SingleRule {
  width: 100%;
  height: 100%;
  padding: 0 5%;
  padding-top: 15px;
}
</style>
